﻿///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 22 2011)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "WxRoboCV_GUI.h"

///////////////////////////////////////////////////////////////////////////

MainFrame_base::MainFrame_base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	m_mgr.SetManagedWindow(this);
	
	m_menubar = new wxMenuBar( 0 );
	m_file_menu = new wxMenu();
	wxMenuItem* m_menu_exit;
	m_menu_exit = new wxMenuItem( m_file_menu, ID_MENU_EXIT, wxString( wxT("Exit") ) + wxT('\t') + wxT("Alt+F4"), wxT("Exit the application"), wxITEM_NORMAL );
	m_file_menu->Append( m_menu_exit );
	
	m_menubar->Append( m_file_menu, wxT("File") ); 
	
	m_camera_menu = new wxMenu();
	wxMenuItem* m_menu_start_camera;
	m_menu_start_camera = new wxMenuItem( m_camera_menu, ID_MENU_START_CAMERA, wxString( wxT("Start camera") ) + wxT('\t') + wxT("Alt+c"), wxEmptyString, wxITEM_NORMAL );
	m_camera_menu->Append( m_menu_start_camera );
	
	wxMenuItem* m_menu_pause_resume;
	m_menu_pause_resume = new wxMenuItem( m_camera_menu, ID_MENU_PAUSE_RESUME, wxString( wxT("&Pause/Resume") ) + wxT('\t') + wxT("Alt+P"), wxEmptyString, wxITEM_NORMAL );
	m_camera_menu->Append( m_menu_pause_resume );
	
	m_menubar->Append( m_camera_menu, wxT("Camera") ); 
	
	this->SetMenuBar( m_menubar );
	
	m_toolbar = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_LAYOUT ); 
	m_toolbar->AddTool( ID_TB_START_CAMERA, wxT("Start camera"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL ); 
	m_toolbar->AddTool( ID_TB_PAUSE_RESUME, wxT("tool"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL ); 
	m_toolbar->Realize();
	m_mgr.AddPane(m_toolbar, wxAuiPaneInfo().ToolbarPane().Top().Floatable(false).LeftDockable(false).RightDockable(false).Movable(false));

	m_log = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(-1, 150), wxTE_DONTWRAP|wxTE_MULTILINE);
	m_mgr.AddPane(m_log, wxAuiPaneInfo().Bottom().Name("Log").Caption("Log").MaximizeButton(true).MinimizeButton(false).PinButton(false).FloatingSize(600, 250).Layer(1));
	
	m_camera_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL);
	m_mgr.AddPane(m_camera_panel, wxAuiPaneInfo().CentrePane().Name("Camera").Caption("Camera").CaptionVisible(true).MaximizeButton(true).MinimizeButton(false).PinButton(false).CloseButton(false));
	
	m_statusbar = this->CreateStatusBar( 3, wxST_SIZEGRIP, wxID_ANY );
	
	m_mgr.Update();
	this->Centre( wxBOTH );
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrame_base::OnClose ) );
	this->Connect( wxEVT_IDLE, wxIdleEventHandler( MainFrame_base::OnIdle ) );
	this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( MainFrame_base::OnUpdateUI ) );
	this->Connect( m_menu_exit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame_base::OnMenuExit ) );
	this->Connect( m_menu_start_camera->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame_base::OnCameraControls ) );
	this->Connect( m_menu_pause_resume->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame_base::OnCameraControls ) );
	this->Connect( ID_TB_START_CAMERA, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrame_base::OnCameraControls ) );
	this->Connect( ID_TB_PAUSE_RESUME, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrame_base::OnCameraControls ) );
	m_camera_panel->Connect( wxEVT_PAINT, wxPaintEventHandler( MainFrame_base::OnCameraPanelPaint ), NULL, this );
	m_camera_panel->Connect( wxEVT_SIZE, wxSizeEventHandler( MainFrame_base::OnCameraPanelSize ), NULL, this );
}

MainFrame_base::~MainFrame_base()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrame_base::OnClose ) );
	this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( MainFrame_base::OnIdle ) );
	this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( MainFrame_base::OnUpdateUI ) );
	this->Disconnect( ID_MENU_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame_base::OnMenuExit ) );
	this->Disconnect( ID_MENU_START_CAMERA, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame_base::OnCameraControls ) );
	this->Disconnect( ID_MENU_PAUSE_RESUME, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame_base::OnCameraControls ) );
	this->Disconnect( ID_TB_START_CAMERA, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrame_base::OnCameraControls ) );
	this->Disconnect( ID_TB_PAUSE_RESUME, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrame_base::OnCameraControls ) );
	m_camera_panel->Disconnect( wxEVT_PAINT, wxPaintEventHandler( MainFrame_base::OnCameraPanelPaint ), NULL, this );
	m_camera_panel->Disconnect( wxEVT_SIZE, wxSizeEventHandler( MainFrame_base::OnCameraPanelSize ), NULL, this );
	
	m_mgr.UnInit();
	
}
